Methods and systems for hinting fonts

ABSTRACT

In one embodiment, a font-hinting system is configured to select a first TrueType font that has been hinted with hints that define constraints between control points associated with individual characters of the font. Individual characters of a second TrueType font that correspond to individual characters of the first TrueType font are identified. The second TrueType font is different from the first TrueType font and individual characters of the second TrueType font are unhinted. Hints are transferred from characters of the first TrueType font to individual corresponding characters of the second TrueType font, and a hint is discarded where it appears inappropriate for a character of the second TrueType font. Further, the system maintains indicia of a discarded hint to indicate where a hint has been discarded.

RELATED APPLICATION

This application is a continuation of and claims priority to both U.S.patent application Ser. No. 10/782,255, filed on Feb. 19, 2004 which, inturn, is a continuation of and claims priority to U.S. patentapplication Ser. No. 09/620,618, filed on Jul. 21, 2000, the disclosureof which is incorporated by reference.

TECHNICAL FIELD

This invention relates to methods and systems for hinting fonts,particularly TrueType fonts.

BACKGROUND

The demand for high-quality hinted fonts is outstripping the ability ofdigital typography houses to produce them. Hinting is a painstakingmanual process that can only be done well by a handful of highly skilledprofessionals. It requires a blend of typographical artistry withtechnological ability. In order to provide a full appreciation of thehinting problem, a review of how digital fonts are scan-converted onto araster display is given.

In digital typography, each character in a font is described by a set ofoutlines, usually represented by splines. When the character is renderedonto a grid of pixels, the outlines are scaled to the desired size, andthen each pixel whose center lies inside of an outline is set to black.When fonts are displayed at sufficiently high resolutions, this approachworks beautifully. But for sizes below about 150 ppem, severe aliasingproblems can result when this naive outline filling process is applied,especially for delicate features such as serifs. As an aside, hintersexpress font sizes in pixels per em, or ppem. This measure counts thenumber of device pixels in the em of the font. In traditionaltypography, the em of a font was the height of the metal block of type.With digital typography, there is no actual metal block to measure, butthe digital outlines are still expressed in coordinates relative to thishypothetical size. The point size of text refers to the size of its emexpressed in points (a point is {fraction (1/72)} of an inch). Thus,“12-point text” would correspond to 12 ppem on a 72 dpi screen, or 100ppem on a 600 dpi printer.

FIG. 1 shows an example of the aliasing problems that can result when anaïve outline filling process is applied. Consider the leftmost image100 in the form of a lower case letter “a” which represents an outlineof the character that is to be filled. The centermost image 102 (absentthe illustrated black pixels 102 a) is generated by a naive algorithm.This pixel pattern does not look much like a lowercase “a”. A simpledropout control mechanism can be added to the fill algorithm to turn onadditional pixels to preserve the character's topology. The resultantpixels that are turned on by the dropout control mechanism are shown inblack at 102 a. The rightmost image 104 illustrates the work of anexperienced hinter. It will be observed that the pixel pattern has beensubtly altered to both improve readability and better preserve thecharacter of the original outline.

The hinting process is not just about optimizing individual characters.The hinter must balance the needs of a single glyph with the desire forconsistency across all the characters of a font. It is important, forexample, to ensure that all the vertical stems of a font are the samenumber of pixels wide at a given size. If the scaling and roundingprocess produces one-pixel-wide stems on some characters andtwo-pixel-wide stems on others, then a passage of text will look blotchyand be difficult to read. The goal of the hinter is to produce a smoothtransition from very high sizes, where merely filling the outlinessuffices and hinting is unnecessary, down to lower sizes, wherelegibility must be preserved even when that means a departure from theoutlines drawn by the original font designer.

Although the ever-improving resolution of hardcopy devices is beginningto approach the point at which hinting is not necessary, the technologyis not there yet: 10- or 12-point text on a 300 or even 600 dpi printerstill needs hinting for best results. More importantly, the increasingemphasis on reading text on-screen—from visions of the “paperlessoffice” to the emergence and proliferation of hand-held computers andeBooks—means that more and more text is being viewed on devices in the72-100 dpi range. Though resolutions of these displays are improving aswell, for the foreseeable future hinting will be an absolute necessityin order to provide clear, legible text.

Although attempts have been made to design automated hinting systems inthe past, even the best of these produce hints that are good, but stillnot up to the standards of professional typographers. Exemplary systemsare described in the following references: Andler, Automatic generationof gridfitting hints for rasterization of outline fonts or graphics,Proceedings of the International Conference on Electronic Publishing,Document Manipulation, and Typography, pps. 221-234, September 1990, andHersch, Character generation under grid constraints, Proceedings ofSIGGRAPH 87, pps. 243-252, July 1987.

This previous work assumed that in order to be useful, an autohinter hadto be a monolithic, self-contained package: outlines in, quality hintsout. That is an admirable goal, and it may be achieved someday. However,given the detailed, aesthetically-based nature of the work, a better,more useful approach is to view the autohinter as one piece of a systemthat includes a human hinter.

There are two major font standards in widespread use today: Type 1 andTrueType. Type 1 fonts (Adobe Systems Inc., Adobe Type 1 Font Format,March 1990), often called “PostScript fonts,” were developed by Adobeand are popular in the world of publishing. Printing applications werethe target when this system was developed, though utilities are nowavailable to enable on-screen display of Type 1 fonts. The TrueTypeformat (Apple Computer, Inc., The TrueType Font Format Specification,1990, Version 1.0), originally developed by Apple, was intended to unifytype on the screen and on paper, and is used in both the Macintosh andWindows operating systems. TrueType has something of a reputation forbeing of low quality, but this is mostly due to the fact that TrueTypewas always an open standard while Type 1 was not, and so the publicdomain is flooded with a large number of poorly designed, unhintedTrueType fonts. The TrueType standard does contain extensive facilitiesfor high-quality hinting, though, and through the efforts of Monotypeand other typography houses, more and more quality fonts are nowavailable in the TrueType format.

Though both formats represent characters as spline-based outlines, thehinting styles are radically different. Hinting for Type 1 fonts worksby marking sections of the outline as corresponding to particulartypographic features of the character—stems, bowls, counters, and so on.It is the job of the rasterizer to take advantage of these hints aboutthe character shape to produce the best possible pattern of pixels. Thisscheme has the advantage that enhancements to the rasterizer can produceimprovements to all fonts on the system, but means that a designer ofdigital type cannot specify exactly what an outline will look like whenrendered at a given size.

The TrueType font technology takes a different approach. Instead ofleaving control over the glyph's final appearance to the rasterizer, aTrueType font contains explicit instructions (hints) about howparticular control points should be shifted to fit the pixel grid. Theseinstructions take the form of a program in a special, TrueType-specificbytecode language. Since both the behavior of each instruction and therasterizing algorithm are defined in the TrueType standard, the designerof a TrueType font can predict exactly which pixels will be turned onfor a character at a given size, no matter what type of output device isbeing used.

In TrueType, each contour of an outline is specified with a sequence ofpoint positions (also referred to herein as “control points” or“knots”). FIG. 2 shows exemplary outline curves of the lowercase letter“a” for two fonts: Trebuchet and Frutiger. Each point is flagged aseither “on-curve” or “off-curve”. TrueType defines the outline asfollows:

-   -   Two successive on-curve points are connected with a straight        line segment.    -   When an off-curve point falls between two on-curve points, the        three are treated as the control points for a quadratic Bézier        segment.    -   When two adjacent off-curve points appear, the midpoint of the        segment connecting them is treated as an implicit on-curve point        between them, allowing reduction to the case above.

The glyph renderer starts by scaling the outlines to a particular size,then executes the attached program to shift control points around in asize-specific way before filling the altered outline. By itself, thisapproach cannot produce the necessary consistency among differentcharacters of a font, or even between different parts of the samecharacter, since each action is necessarily local. Globalsynchronization of outline alterations is achieved through use of acontrol value table, or CVT. The CVT is a shared table of distances,that can be referenced by instructions in each glyph's program. When therendering is initialized for a given size, the values in the CVT arescaled and rounded to the current grid size. Point movements can then beconstrained by CVT entries. For instance, a person writing hints forTrueType may decide to use CVT 81 to represent, say, the width ofvertical black stems in lowercase letters. He or she will then writeinstruction sequences for all appropriate lowercase letters, allreferring to CVT entry 81, so that all the vertical black stems at agiven size will have the same width.

The TrueType language is an assembly-style stack-based language. Theintent of the designers of TrueType was not to make typographers learnand write in the TrueType language itself, but rather to facilitate thedevelopment of high-level languages and tools that generate TrueTypecode. The Visual TrueType (VTT) package from Microsoft is such a tool.VTT is described in detail in Stamm, A Graphical Method for AuthoringFont Intelligence, Electronic Publishing, Raster Imaging, and DigitalTypography, pps. 77-92, March/April 1998.

VTT provides a high-level language, called “VTT Talk”, for expressingrelationships between points. VTT Talk provides statements forexpressing the following classes of hints:

-   -   Link constraints: the vertical or horizontal distance between a        pair of knots is constrained by an entry in the CVT.    -   Dist constraints: the “natural” vertical or horizontal distance        between a pair of knots is maintained, so that if one point is        moved the other moves in parallel.    -   Interpolate constraints: a knot's fractional distance between        two parent knots is maintained.    -   Anchors: specific knots can be rounded to the nearest gridline,        or to a gridline specified by a CVT entry.

These types of hints are demonstrated visually for two characters fromthe Georgia Roman font in FIG. 3. There, the constraints are labeled foridentification.

The VTT Talk hints are compiled into a TrueType program stored in thefont file. One advantage of working with VTT Talk is that each statementsimply asserts a relationship between two points, and there is littledependence on the order of the statements. If one statement is omitted,the meaning of the others is unchanged. In contrast, TrueType assembleris a sequential language that maintains a fairly complex state. Mostinstructions in TrueType have side effects that modify this state. Ifone tried to translate the assembler code directly, and were for somereason unable to translate a particular instruction—for instance, due toa sufficiently large difference in the matched glyphs' outlines—theeffects of subsequent instructions could change entirely.

This invention arose out of concerns associated with improving thesystems and methods through which hinting takes place. In particular,the invention arose out of concerns associated with improving TrueTypehinting systems and tools.

SUMMARY

In one embodiment, a font-hinting system is configured to select a firstTrueType font that has been hinted with hints that define constraintsbetween control points associated with individual characters of thefont. Individual characters of a second TrueType font that correspond toindividual characters of the first TrueType font are identified. Thesecond TrueType font is different from the first TrueType font andindividual characters of the second TrueType font are unhinted. Hintsare transferred from characters of the first TrueType font to individualcorresponding characters of the second TrueType font, and a hint isdiscarded where it appears inappropriate for a character of the secondTrueType font. Further, the system maintains indicia of a discarded hintto indicate where a hint has been discarded.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates outline for the Palatino Italic “a”, along with apixel pattern generated by rasterizing the outlines for display of18-point text on a 72 dpi device.

FIG. 2 illustrates, for two different TrueType fonts, various “on-curve”and “off-curve” control points that are used to define hints for thefonts.

FIG. 3 illustrates a visualization of VTT Talk hints created by aprofessional hinter for two characters of Georgia Roman.

FIG. 4 is a high level diagram of a computer system that can be utilizedto implement an autohinter in accordance with the described embodiment.

FIG. 5 is a flow diagram that describes steps in a method in accordancewith the described embodiment.

FIGS. 6-8 illustrate different features that are utilized to ascertain ascore for a pair of control points in accordance with the describedembodiment.

FIG. 9 illustrates one way in which control points can be paired forpurposes of generating a score.

FIG. 10 illustrates a final match between control points for the twocharacters of FIG. 2 in accordance with the described embodiment.

FIG. 11 illustrates a final match for two different characters inaccordance with the described embodiment.

FIG. 12 is a flow diagram that describes steps in a method in accordancewith the described embodiment.

FIG. 13 is a flow diagram that describes steps in a method in accordancewith the described embodiment.

FIG. 14 visually illustrates the outcome of a process in which controlvalue table (CVT) values for one font were transferred to another font.

FIGS. 15-19 visually illustrate hints transferred from one font toanother.

FIG. 20 illustrates the Sylfaen Sans Bold font, both unhinted and withhints transferred from Sylfaen Sans Roman.

FIG. 21 illustrates the Georgia Bold font, both unhinted and with hintstransferred from Georgia Roman.

DETAILED DESCRIPTION

Overview

The inventive approach described below was primarily motivated by thework of Hersch and Betrisey, see, e.g. Hersch and Betrisey, Model-basedMatching and Hinting of Fonts, Proceedings of SIGGRAPH 91, pps. 71-80,Jul. 22, 1991. In that method, hints are generated for each glyph bymatching its outline to a human-constructed generic model of thatcharacter's shape (for example, a generic uppercase roman ‘B’). Themodel consists of two representations of the generic character shape. Askeleton model builds the character out of solid parts, labeled asstems, bowls, serifs, and so on. A contour model is an outlinerepresentation of the character, constructed to have as few controlpoints as possible while still spanning the space of possible charactershapes. The correspondences between the two models are known becausethey are specified by hand when the model is built. In their method, theoutlines of the glyph to be hinted are matched to the correspondingcontour model by a fairly complex process that takes into account bothglobal and local features. Points are classified by their positionrelative to the baseline, cap-height and x-height lines, and left andright sidebearings. Local features distinguishing points are based onthe curvature, direction, and orientation of the adjacent curvesegments. Once the correspondence between the unknown outline and themodel outline is established, the known correspondence between the modeloutline and the model skeleton can be used to label parts of the unknownoutline as belonging to significant features such as stems and serifs.From this labeling a set of Type 1-style hints for the new outline canbe derived.

Hersch and Betrisey's work requires a manually constructed model inorder to link points on the outline with the “semantic” features neededfor hinting. Hinting in TrueType does not require an explicit labelingof these features. Rather, this information is implicitly used by thehuman typographer when deciding on a hinting strategy for the character.The end result expressed in the font is simply a set of relationships,or constraints, between control points. These constraints obviate theneed for the skeleton model—once we find the correspondence between acontour model and the outlines of the target glyph, hints can beimmediately produced for the target outline without transitivelyapplying a second correspondence.

In the inventive approach, we have reduced our needs to having a contourmodel with control-point-level hints attached to it. Advantageously, aTrueType font that has already been hinted is used as the contour model.This has a number of advantages over using a specialized model builtexpressly for the auto-hinter.

First, there are immediately a wide variety of fonts from which tochoose as templates. Moreover, choosing a template close to the targetfont will increase the likelihood of a good match, and consequently thequality of the resulting hints. Advantageously, a template font can beselected from a library automatically, or within a typefaceclassification system, or different template fonts can be chosen fordifferent characters of the target. Another advantage of using realhinted fonts as templates is that typographers, rather than computerscientists, can build templates using tools with which they familiar.Furthermore, each typographer can build templates to suit his or herhinting style.

Exemplary Computer System

FIG. 4 is a high level block diagram of an exemplary computer system 130that can be programmed to function as an automated hinting systemreferred to as an “autohinter”.

Computer 130 includes one or more processors or processing units 132, asystem memory 134, and a bus 136 that couples various system componentsincluding the system memory 134 to processors 132. The bus 136represents one or more of any of several types of bus structures,including a memory bus or memory controller, a peripheral bus, anaccelerated graphics port, and a processor or local bus using any of avariety of bus architectures. The system memory 134 includes read onlymemory (ROM) 138 and random access memory (RAM) 140. A basicinput/output system (BIOS) 142, containing the basic routines that helpto transfer information between elements within computer 130, such asduring start-up, is stored in ROM 138.

Computer 130 further includes a hard disk drive 144 for reading from andwriting to a hard disk (not shown), a magnetic disk drive 146 forreading from and writing to a removable magnetic disk 148, and anoptical disk drive 150 for reading from or writing to a removableoptical disk 152 such as a CD ROM or other optical media. The hard diskdrive 144, magnetic disk drive 146, and optical disk drive 150 areconnected to the bus 136 by an SCSI interface 154 or some otherappropriate interface. The drives and their associated computer-readablemedia provide nonvolatile storage of computer-readable instructions,data structures, program modules and other data for computer 130.Although the exemplary environment described herein employs a hard disk,a removable magnetic disk 148 and a removable optical disk 152, itshould be appreciated by those skilled in the art that other types ofcomputer-readable media which can store data that is accessible by acomputer, such as magnetic cassettes, flash memory cards, digital videodisks, random access memories (RAMs), read only memories (ROMs), and thelike, may also be used in the exemplary operating environment.

A number of program modules may be stored on the hard disk 144, magneticdisk 148, optical disk 152, ROM 138, or RAM 140, including an operatingsystem 158, one or more application programs 160, other program modules162, and program data 164. A user may enter commands and informationinto computer 130 through input devices such as a keyboard 166 and apointing device 168. Other input devices (not shown) may include amicrophone, joystick, game pad, satellite dish, scanner, or the like.These and other input devices are connected to the processing unit 132through an interface 170 that is coupled to the bus 136. A monitor 172or other type of display device is also connected to the bus 136 via aninterface, such as a video adapter 174. In addition to the monitor,personal computers typically include other peripheral output devices(not shown) such as speakers and printers.

Computer 130 commonly operates in a networked environment using logicalconnections to one or more remote computers, such as a remote computer176. The remote computer 176 may be another personal computer, a server,a router, a network PC, a peer device or other common network node, andtypically includes many or all of the elements described above relativeto computer 130, although only a memory storage device 178 has beenillustrated in FIG. 4. The logical connections depicted in FIG. 4include a local area network (LAN) 180 and a wide area network (WAN)182. Such networking environments are commonplace in offices,enterprise-wide computer networks, intranets, and the Internet.

When used in a LAN networking environment, computer 130 is connected tothe local network 180 through a network interface or adapter 184. Whenused in a WAN networking environment, computer 130 typically includes amodem 186 or other means for establishing communications over the widearea network 182, such as the Internet. The modem 186, which may beinternal or external, is connected to the bus 136 via a serial portinterface 156. In a networked environment, program modules depictedrelative to the personal computer 130, or portions thereof, may bestored in the remote memory storage device. It will be appreciated thatthe network connections shown are exemplary and other means ofestablishing a communications link between the computers may be used.

Generally, the data processors of computer 130 are programmed by meansof instructions stored at different times in the variouscomputer-readable storage media of the computer. Programs and operatingsystems are typically distributed, for example, on floppy disks orCD-ROMs. From there, they are installed or loaded into the secondarymemory of a computer. At execution, they are loaded at least partiallyinto the computer's primary electronic memory. The invention describedherein includes these and other various types of computer-readablestorage media when such media contain instructions or programs forimplementing the steps described below in conjunction with amicroprocessor or other data processor. The invention also includes thecomputer itself when programmed according to the methods and techniquesdescribed below.

For purposes of illustration, programs and other executable programcomponents such as the operating system are illustrated herein asdiscrete blocks, although it is recognized that such programs andcomponents reside at various times in different storage components ofthe computer, and are executed by the data processor(s) of the computer.

Exemplary Processing Technique Overview

FIG. 5 shows a flow diagram that describes steps in a processing methodin accordance with the described embodiment. The method isadvantageously implemented in software in connection with an automatedprogrammed autohinter, although it could be implemented in any suitablehardware, software, firmware, or combination thereof.

Step 500 provides a source character from which hints are going to betranslated or transferred. As was pointed out above, the sourcecharacter is advantageously a character that has already been hinted.This constitutes a dramatic improvement in flexibility and processingtime over other methods in which hints are not translated frompreviously-hinted fonts. Step 502 provides a target character to whichthe hints from the source character are to be translated or transferred.Step 504 matches contours or outlines of the source and targetcharacters. The goal of this step is to identify and pair contours onthe source and target characters that are like contours. For example,the lower case letter “a” has two contours—an inner contour (definingthe enclosed inner area in the body of the letter) and an outer contour(defining the outer perimeter and hence shape of the letter). This stepensures that like contours from the source character and the targetcharacter are paired together. A specific example of one way ofaccomplishing this task is described in the section entitled “Matchingthe Outlines” below.

Once the contours are matched, step 506 attempts to match knots (i.e.control points) on one of the contours with knots on the other of thecontours. Throughout this document, the terms “knots” and “controlpoints” will be used interchangably. Recall that each contour is definedby or associated with a number of control points that are eitheron-curve or off curve. What this step attempts to do is to find a “bestmatch” between the control points on the matched contour pair. In theillustrated and described embodiment, this step is accomplished byestablishing quantifiable criteria and then examining and scoring knotpairs on the two contours. It will be appreciated that step 506 isperformed a number of different times for each pair of matched contours.This produces, in turn, a quantified measurement that gives anindication of the desirability of a particular association of knotsbetween the outlines. From these quantified measurements, a bestmeasurement is selected as constituting the “best match” between thecontrol points on the different outlines or contours. An example of oneway of accomplishing this task is given below in the section entitled“Calculating a Score”.

Step 508 then checks to see whether there are any additional contourpairs for evaluation. If there are, step 510 gets the next pair ofcontours and returns to step 506. If there are no additional contourpairs, then step 512 translates hints from the source character to thetarget character. An example of how this task can be accomplished isgiven below in the section entitled “Hint Translation”.

Matching the Outlines

Referring back to FIG. 2, two glyphs 200, 202 are shown and represent asingle character—lowercase “a′. Within this document, the terms “glyphs”and “characters” are used interchangably.

Glyph 200 constitutes a source character in the Trebuchet font which hasalready been hinted and from which hints are to be transferred. Glyph202 constitutes a target character in the Frutiger that has not beenhinted and to which hints from glyph 200 are to be transferred. In thisparticular example, each glyph has two outlines or contours that are tobe matched. The outlines for source character 200 are shown at 200 a,200 b and the outlines for target character 202 are shown at 202 a, 202b.

A primary goal of the process described below is to translate hints thatrefer to control points on the source character or outline to hints thatrefer to control points on the target character or outline. As indicatedabove, control points for the two characters are indicated as either asolid dot (to indicate on-curve control points or knots) or an open dot(to indicate off-curve control points or knots).

The algorithmic approach described below attempts to match up expliciton-curve knots using features such as contour direction and the presenceof extrema. The on-curve knots typically have far more significance tothe shape and extents of the contour. Once a match is computed betweenthe on-curve knots, an attempt is made to pair up the remaining knots bysimply counting the number of off-curve knots between each pair ofmatched on-curve knots. If the numbers are equal, then the off-curveknots are paired based solely on their order. Only a very small fractionof hints involve these off-curve knots, but this is done to preserve asmany of the source hints as possible.

Many glyphs are defined by multiple contours, but there are norestrictions on what order the contours are listed in. Therefore, afirst task is to determine which contour goes with which in the twoglyphs. In the illustrated example, this is done by enumerating all thepossibilities for a one-to-one pairing of the contours. (The hinterrejects input outline pairs with differing numbers of contours). A scoreis calculated for each pairing as follows. Suppose that the targetcharacter is scaled and translated so that its bounding box is equal tothat of the source character. For each individual contour within thecharacters, a sum is computed of the absolute values of the differencesbetween corresponding sides of the contour bounding boxes. This value,summed over all the contours, gives the score for the match, with thelowest value being the best match. Of course, other methods could beused without departing from the spirit and scope of the claimed subjectmatter.

Knot Matching

After the outlines or contours have been matched, an attempt is made tomatch the knots or control points on each of the outlines so that abasis for transferring hints can be established.

In the illustrated example, this is done by pairing individual controlpoints on the outlines, and evaluating the point pairs in accordancewith established criteria to ascertain a score that rates their match.Although any suitable criteria can be used, in the illustrated examplethe criteria take the following form, each of which is explained in moredetail below: (1) incoming and outgoing direction, (2) local minimum ormaximum, (3) incoming and outgoing lines straight or curved, and (4)band matches.

The pairing of the individual control points on the outlines defines asingle set of multiple control point pairs. The process is repeatedmultiple times so that multiple sets are defined. A score is calculatedfor each set and a set that has the best overall score is selected as abasis for transferring the hints.

Incoming/Outgoing Direction

FIG. 6 shows the characters of FIG. 2 highlighted in a manner thatillustrates a first feature that is used for ascertaining a score for amatch between control points—incoming/outgoing direction. Specifically,each knot or control point has an incoming and an outgoing directionassociated with it. The direction is based on the tangents of the curvestouching that knot or control point.

In the illustrated example, a clockwise convention is used and thedirections are indicated by the arrows that are either pointed toward oraway from any one knot. The direction is quantitized to one of eightpossibilities, corresponding to the eight compass directions, e.g.north, northeast, east, southeast, south, southwest, west, andnorthwest. A pair of knots on the two characters is assigned from 200 to−200 points based on the similarity of each direction. For example, aknot with an incoming direction of “north,” gets 200 points when matchedwith another “north” knot, 100 points for a “northeast” or “northwest”match, 0 points for “east” or “west”, −100 points for “southeast” or“southwest”, and −200 points for matching a “south” knot. This score iscalculated for both the incoming and outgoing direction.

Local Minimum or Maximum

FIG. 7 shows the characters of FIG. 2 highlighted in a manner thatillustrates a second feature that is used for ascertaining a score for amatch between control points—local minimum or maximum. Specifically,each knot can be flagged as a local minimum or maximum in each of the xor y directions. A knot with one of these flags will contribute 150points when matched with a knot with the same flag, or −150 points whenmatched to the opposite flag. In the FIG. 7 illustration, local extremaare indicated by the triangles at each of the appropriate knots. A knotmay not be an extremum at all in a given direction, in which case anymatch will not produce a score for this category.

Incoming and Outgoing Lines Straight or Curved

FIG. 8 shows the characters of FIG. 2 highlighted in a manner thatillustrates a third feature that is used for ascertaining a score for amatch between control points—incoming and outgoing lines straight orcurved. Specifically, each knot has a flag to indicate whether theincoming and outgoing lines are straight (within some tolerance) orcurved. In the illustrated example, curved incoming or outgoing linesare indicated as solid lines, while straight incoming or outgoing linesare indicated as dashed lines. Matching these flags produces a score of100 points, but not matching them produces no penalty.

Band Matches

Another feature that is utilized to ascertain a score for a matchbetween control points is referred to as “band matches”. Here, thevertical and horizontal extents of a particular contour are divided intoa number of equally spaced bands, e.g. five bands. Corresponding knotson the different contours are given a score of 400 points if they fallinto the same band, and 200 points if they fall into an adjacent band.Any other distribution does nothing to the score. This process iscarried out twice for each contour-once for the horizontal direction andonce for the vertical direction. Consider again FIG. 8. There, twodifferent band groupings 800, 802 are shown that might be used to assessthe horizontal extents of each contour. Accordingly, this featureassesses the desirability of a match by considering whether each controlpoint of a pair falls into one of a plurality of common bands that aredefined for each character.

Generating the Matches

FIG. 9 shows the characters of FIG. 2 and will assist in understandingan exemplary pairing and matching process in accordance with thedescribed embodiment.

To generate knot pairs (control point pairs), an arbitrary starting knoton each contour to be matched is selected and then paired together. Forexample, consider that the outer contour for each character 200, 202 isundergoing a knot-pairing process. The starting knot on the outercontour for character 200 might be knot 900, while the starting knot onthe outer contour for character 202 might be 900 a. These two knotsconstitute one pair of knots.

After the starting knots are selected, the other knots on the source andtarget outline are paired in a predetermined manner. This definesmultiple knot pairs that collectively define one set of knot pairs. Inthe illustrated example, the pairing takes place by moving, in a defineddirection, around the source contour to the next knot, and pairing eachknot with the knot on the target contour whose fractional arc lengthrelative to the starting knot is closest to that of the source knot. Inthe illustrated example, this next pairing might constitute knots 902,902 a. This process is repeated for all of the knots on the sourcecontour until all source knots are paired up with a corresponding targetknot. This pairing of all of the source knots generates the set of knotpairs.

A local feature score is calculated for each pair of knots, e.g. a localfeature score is calculated for pairs 900-900 a, 902-902 a, etc. Oneexample of how this can be done is given above. Once all of the localfeature scores are calculated for all of the knot pairs, the scores aresummed to provide an overall score that rates the quality of the overallmatch of the contours.

In the present example, it will be appreciated that the selectedstarting points on the source and target outline (i.e. points 900, 900a) would not generate a score that reflects a high quality match. Thisis because point 900 is located on the bottom portion of the characterand point 900 a is located on the top portion of the character and thus,these points do not have much in common. Thus, these particular pairingsof source and target knots is not the most optimal.

A different set of knot pairings is now generated and evaluated asdescribed above. In the illustrated example, this can be done bymaintaining the starting knot on the source contour (i.e. knot 900) andmoving to a different starting knot on the target contour (e.g. knot 902a). The pairing process for each knot on the source contour is repeatedas described above so that all of the source knots are paired. For eachpair of knots, a local feature score is calculated, and all of the localfeature scores are summed to rate the quality of the overall match.

This process is repeated so that every knot on the target contour isused as a starting knot for purposes of computing a local feature score.

The output of this process provides multiple sets of knot pairs and eachset has a score that is calculated as described above. In theillustrated example, the number of scores will be equal to the number ofknots on the target outline because each target knot is used as astarting knot for a set of knot pairings.

The set of scores is reduced by selecting the five matches with thehighest summed local-feature scores. Each of the scores of the reducedset of scores is then further processed to attempt to improve it. Thisis done by manipulating the individual knot pairings of the set thatgenerated a particular score. Specifically, pairings between knot pairsthat generated a negative local-feature score are removed so that theknots are not paired together. Then, unpaired source knots are attemptedto be paired with other target knots. Additionally, existing knot pairsare shifted to adjacent target knots. All of this processing is subjectto the constraint that the knot match respect the ordering of knotsaround the contour: e.g., if knot B follows knot A in the sourcecontour, then the partner of knot B should not come before the partnerof knot A on the target contour.

Once this local improvement processing has been conducted on each of thefive top matches, the match with the highest final score is selected asthe final match.

FIG. 10 shows the results of this matching algorithm. These heuristicswork well for a wide variety of character styles, including roman, bold,and italic characters. A matching for a more complex pair of glyphs isshown in FIG. 11.

FIG. 12 is a flow diagram that describes steps in a matching algorithmin accordance with the described embodiment. The method isadvantageously implemented in software. Step 1200 selects starting knotson the source and target contours. Step 1202 pairs each source knot witha target knot, starting at the starting knots and working around thesource contour in a predetermined manner. Step 1204 calculates a localfeature score for each knot pair. One example of how this can be done isgiven above. When all of the local feature scores have been calculatedfor the individual knot pairs, step 1206 sums the local feature scoresto provide an overall score that gives an indication of the quality ofthe overall match. Advantageously, this process is carried out multipletimes so that a set of overall scores is generated for different sets ofknot pairings.

In the illustrated and described embodiment, each of the target knots isused as a starting knot for a set of knot pairings. Accordingly, step1208 ascertains whether all of the target knots have been used as astarting knot. If all of the target knots have not been used as astarting knot, step 1210 selects a different target knot as a startingknot (while maintaining the original source starting knot) and returnsto step 1202. The result of this step is that a different pair of knotsis defined that can generate different local feature scores (step 1204)and a different overall score (step 1206).

Once all of the target knots have been used as a starting knot, step1212 selects a predetermined number of the best scores (e.g. the fivebest scores) and step 1214 attempts to improve each selected score byperturbing knot pairings that contributed to that overall score. Oncethe highest score has been found, step 1216 selects the match with thehighest score and uses that match as the basis for transferring hints tothe target character.

The above description illustrates but one way of implementing aknot-matching process. It is to be understood that other approaches canbe implemented without departing from the spirit and scope of theclaimed subject matter.

Hint Translation

Having produced a “best match” between the knots of the source characteroutline and those of the target character outline, the hints that areassociated with the source character can now be translated ortransferred from the source character to the target character.

FIG. 13 is a flow diagram that describes an exemplary hint transferringprocess in which VTT Talk hints are transferred from a source characterto a target character. It will be appreciated and understood that whilethe example is given in the context of VTT Talk hints for TrueTypehints, it is possible for the methodologies described below to beimplemented in connection with other differently defined hints.

Step 1300 defines a match between a source character and a targetcharacter. One exemplary way of accomplishing this task is describedabove in connection with FIG. 12. Once the match is defined, step 1302transfers hints from the source character to the target character. Totransfer the hints in this example, the source font's VTT Talk hints areparsed (step 1304) and copied (step 1306) to the target font. Knotnumbers are replaced (step 1308) as appropriate according to the match.If there is not a match for a knot referenced in a particular statement,the source statement is copied unchanged, but is commented out (step1310) to mark it as a place that may need special attention by a personreviewing the font.

In this manner, hints that were specifically defined for the sourcecharacter in terms of the source character's knots or control points,are automatically transferred or translated to the target characterwhere the transferred hints now refer specifically to the targetcharacter's knots or control points.

CVT Translation

The Control Value Table (CVT) is a central feature of the TrueTypehinting mechanism, and no TrueType autohinting scheme would be completewithout addressing it.

In VTT Talk, entries of the CVT are used via statements such as:

-   -   YLink(14,0,87)

This statement says, in effect, “move knot 0 up or down so that itsvertical distance from knot 14 is equal to the value in CVT entry 87.”

In the illustrated example, a matching module translates the referencesto specific knots to their analogues in the new font based upon thematches. In addition, the same CVT entry numbers (e.g. “87”) as wereused in the original font can still be used, although the valuesassociated with those entry numbers will likely need to be changed. Thereason for this is that the old values in the CVT represent distancesmeasured in the source font, which may bear little or no relation todistances in the target font.

A solution for which values to insert into the CVT comes fromrecognizing that the major reason the CVT is used is to take a set ofdistances that are approximately the same in the outline, and force themto be exactly the same number of pixels in a rendered bitmap. Since thegoal is to provide this consistency while changing the outlines aslittle as possible, the CVT entry will generally contain some averagevalue that is close to all the distances it is going to be used toconstrain. Using this knowledge, we can look at all of the uses of aparticular CVT entry to estimate what its value should be.

As an example, consider FIG. 14 and how this works on the ‘a’ character.The top row shows characters from the font Trebuchet. The typographerhinting this font chose to use CVT entry 87 to represent the height ofround, black features in lowercase characters, as indicated by the linesbetween the control points. Most of the lowercase letters that haveround parts reference CVT 87, as indicated in the top row of FIG. 14.The ‘a’ glyph alone uses entry 87 six times—that is, there are six pairsof knots in the ‘a’ whose distance is constrained by CVT entry 87. Thebottom row shows the font Frutiger, along with the uses of CVT entry 87as transferred from Trebuchet by a suitably programmed autohinter. Lines1400 indicate where hints were automatically discarded because thenatural distance between these points was too different from the valuein the CVT table. Accordingly, hints are disgarded where they appear tobe inappropriate for a character of the font to be hinted.

The table immediately below shows the “natural” distances between eachof these pairs in the Frutiger font for each of the indicated glyphs.Glyph References to CVT entry 87 “a” 75* 143 143 156 156 164 “b” 111*113* 156 156 “c” 156 156 160 172 “d” 111* 113* 156 156 “e” 156 156 193*“f” 155 156 “g” 45* 45* 111* 156 156 178 “h” 156

As indicated, one pair of points in the ‘a’ is 75 units apart verticallyin the unhinted outline, another is 143 units, and so on. To determinethe overall value to place in the CVT entry, the median of all theseindividual values is computed, which in this case is 156 units. Thestarred numbers in the listing indicate those uses of the CVT entrywhere the natural outline distance differs by more than 20% from themedian value. These values are designated as outliers, and the hintscorresponding to those points are removed (i.e. commented out) duringthe translation process, as they usually represent cases where the shapeof the target character differs enough from that of the source characterthat the CVT constraint is inappropriate. These commented-outconstraints correspond to the lines designated at 1400. Thecommented-out hints can be maintained, however, in commented-out form sothat a person fine-tuning the results can quickly see where theautohinter disgarded various hints, thereby possibly necessitatingmanual work in the area.

Note that Trebuchet has a so-called spectacle g, while Frutiger has amulti-story g. In this case, it is likely that two the forms of the ‘g’require entirely different hinting strategies, since many of the hintsof the source ‘g’ are simply not appropriate for the target charactershape. These inappropriate hints are automatically discarded by theoutlier mechanism.

It will be appreciated that the CVT has a hierarchical aspect in thesense that entries in the table can refer to other entries whoseassociated values might be used in certain circumstances. For example,one CVT entry might specify a width value to use above a certain pointsize, but for point sizes below the certain point size, a different CVTentry is to be used to constrain the width. The above translation of CVTvalues takes into account these dependencies when the table values arechanged.

Conditional Hint Specification

In the above discussion, the hints that are being transferred have acharacteristic in that they are essentially maintained through all sizesof fonts. There are other hints, however, that are specific to a givensize or range of sizes. For example, a typographer may have physicallyaltered the hints of a character at a certain size to make it lookbetter. That is, at a certain size a certain condition may occur thathas an undesirable effect on the rendered character, e.g. the charactermay have a portion that closes up undesirably. In this embodiment, oneor more conditions can be defined that result in a certain hint beingapplied to the character if the condition is satisfied. Advantageously,these conditionally-specified hints can be transferred from a sourcecharacter to a target character or from a source font to a target font.Thus, if the same condition occurs in the automatically hinted targetfont, the conditionally-specified hint can be applied in the targetcharacter to eliminate the undesirable condition.

Effective Removal of Control Points

There are circumstances where certain characters have subtleties in theoutlines that look good at higher resolutions, but do not look good atlower resolutions. To deal with this situation, there is a way tomanipulate the control points of the character so that the subjectcontrol point(s) that give rise to the subtlety are effectively removed.This is done by programmatically relocating the control point so that itlies on top of another control point. By doing this, the control pointis effectively, but not actually, removed. Advantageously, in thedescribed embodiment, these effectively removed control points aretransferred to the target character so that similar undesirablesubtleties in the target character are effectively eliminated as well.

ClearType

The above described methods are applicable to ClearType hinting.ClearType is a method of rendering fonts that takes advantage of specialproperties of LCD screens (such as laptops or PDAs). The TrueTyperendering mechanism is unchanged, but for best results, the hintershould alter his or her strategy for hinting the character. Generallyspeaking, due to increased effective horizontal resolution thatClearType gives, fonts to be displayed with ClearType need much lesshinting in the x-direction than fonts intended for CRT display. Theabove-describe hinting strategy is employable as for TrueType fonts thatemploy a ClearType strategy.

Results

In an example application two TrueType fonts were taken as input: asource font, from which the hints are transferred; and a target font,which is automatically hinted by an application program executing on acomputerized hinting system. The application program took under a minuteto match the outlines, translate the hints, and create the new CVT for a256-character font.

Once the target font is hinted, however, it should still be reviewed byhand and corrected by an experienced typographer. Even minor errors inthe translated hints or CVT can take a considerable amount of time toidentify and correct, so the translation should be as accurate aspossible in order to be useful.

For the explanation that follows, reference is made to FIGS. 15-19, eachof which visually demonstrates hints that are transferred from a fullyhinted Georgia Roman font to an unhinted different font. For example,FIG. 15 shows hints transferred from Georgia Roman to Georgia Bold; FIG.16 shows hints transferred from Georgia Roman to Bodoni; FIG. 17 showshints transferred from Georgia Roman to Calisto; FIG. 18 shows hintstransferred from Georgia Roman to Perpetua; FIG. 19 shows hintstransferred from Georgia Roman to Revival.

FIGS. 20 and 21 compare the unhinted versions of Sylfaen Sans Bold andGeorgia Bold, respectively, to the versions hinted automatically, at 16,17, and 19 ppem, the most commonly used on-screen sizes. In theseexamples it is clear that most of the objectionable artifacts in theunhinted versions have already been corrected by the automatic hinting.Note, for instance, the improved ‘O’ shapes and the much more uniformstem weights in both fonts. Still, the autohinted versions are notperfect; note for instance where the bowl of the Georgia Bold ‘b’ hasnarrowed unacceptably, especially at lower sizes. Imperfections likethese will need to be corrected by hand.

The method described above was evaluated by using the applicationprogram to transfer hints between three pairs of fonts within the samefamily (Sylfaen Sans Bold from Sylfaen Sans, Georgia Bold from Georgia,and Georgia Bold Italic from Georgia Italic) as well as four targetfonts from a source font of a different font family (Bodoni, Calisto,Perpetua, and Revival—all from Georgia). The table immediately belowsummarizes the results of these tests. Success Review and Manual SourceTarget rate clean up Hinting Savings Font Font (%) (min.) (min.) (%)Sylfaen Sylfaen 84% 5.9 9.4 37% Sans Sans Bold Georgia Georgia 86% 6.77.9 15% Italic Bold Italic Georgia Georgia 93% 4.6 7.1 35% Roman BoldGeorgia Bodoni 78% 3.3 3.3  0% Roman Georgia Calisto 74% 3.0 4.3 30%Roman Georgia Perpetua 76% 1.2 2.7 56% Roman Georgia Revival 82% 1.3 2.343% Roman

In each case, just the alphanumeric glyphs were hinted. The “successrate” column gives the percentage of 62 glyphs in which the transferredhints basically worked. More specifically, for a “successful” glyph, theoverall appearance of the glyph conformed to the original outline athigh sizes (38 ppem and above) without any stretching or distortion,whereas below 38 ppem there might be some cleaning up to do, but nomajor reshaping or rethinking of the hints. If a glyph did not conformto its original outline at high sizes or required major reshaping at lowsizes, then it was considered “unsuccessful.”

As can be seen from the table, the hinter had a fairly high success rateby this measure, especially when hinting characters within the same fontfamily. The next column (Review and cleanup) gives an estimate of thenumber of minutes required for an experienced typographer to review theresults of the autohinter and clean up any problems in the transferredhints. The figures in this column were estimated by performing thisprocess on some 3 to 11 representative glyphs in the target font. Thesesame glyphs were also manually hinted by the same typographer and thetimes required reported in the following column. Finally, the right-mostcolumn provides an estimate of the overall time savings provided by theexample-based hinter.

Note that the very high success rate of the hinter translates into amore moderate overall time savings, since even a perfectly-hinted fontrequires time to review, and since a few small problems in the hints canbe time-consuming to correct. Still, these savings are significant,considering that a full font of 256 characters can take on the order of20-40 hours for a skilled professional to produce.

Conclusion

Methods and systems for automatically hinting TrueType fonts have beendescribed. The inventive approaches use an existing, fully-hinted fontas a template, thereby allowing the hints of one font to be transferredto another. This translation process includes estimation of the controlvalue table (CVT) entries that are used to unify feature sizes across afont. Utility is derived from the described matching algorithm from notonly its simplicity, but from its ability to be applied to and work wellfor a wide variety of character shapes, including serifed and italicfonts.

An important advantage of the described approach over previousautohinters is that the described approach preserves the hand-craftedhinting strategy, built by a professional typographer, in the newlyhinted font. Thus, the translated hints provide an excellent startingpoint and generally require only minor cleanup and adjustment.

Although the invention has been described in language specific tostructural features and/or methodological steps, it is to be understoodthat the invention defined in the appended claims is not necessarilylimited to the specific features or steps described. Rather, thespecific features and steps are disclosed as preferred forms ofimplementing the claimed invention.

1. A system comprising: means for selecting a first TrueType font thathas been hinted with hints that define constraints between controlpoints associated with individual characters of the font; means foridentifying individual characters of a second TrueType font thatcorrespond to individual characters of the first TrueType font, thesecond TrueType font being different from the first TrueType font,individual characters of the second TrueType font being unhinted; meansfor transferring hints from characters of the first TrueType font toindividual corresponding characters of the second TrueType font; meansfor discarding a hint where it appears inappropriate for a character ofthe second TrueType font; and means for maintaining indicia of adiscarded hint to indicate where a hint has been discarded.
 2. Thesystem of claim 1, wherein the first TrueType font comprises a font thathas control-point level hints attached to it and said means fortransferring of the hints comprises means for transferring thecontrol-point level hints from characters of the first TrueType font tocontrol-point level hints in characters of the second TrueType font. 3.The system of claim 2, wherein at least one control point of the firstTrueType font has been programmatically relocated to lie on top ofanother control point of the first TrueType font.
 4. The system of claim1, wherein said means for selecting comprises means for selecting thefirst TrueType font from among a number of different fully hintedTrueType fonts.
 5. The system of claim 1, wherein said means forselecting comprises means for automatically selecting the first TrueTypefont from among a number of different fully hinted TrueType fonts thatare resident in a library.
 6. The system of claim 1, wherein said meansfor selecting comprises means for selecting a TrueType font that isdifferent from the first and second TrueType fonts, and means fortransferring hints from characters of the selected different TrueTypefont to individual characters of the second TrueType font.
 7. The systemof claim 1, wherein said means for identifying comprises means formatching one or more contours on a character of the first TrueType fontwith one or more contours of a character of the second TrueType font. 8.The system of claim 1, further comprising means for pairing individualpoints associated with a contour of the character of the first TrueTypefont with individual respective points associated with a correspondingcontour of the character of the second TrueType font.
 9. The system ofclaim 8, wherein said means for transferring comprises means fortransferring hints that are defined in terms of the individual pointsassociated with the contour of the character of the first TrueType font.10. The system of claim 8, wherein said means for transferring comprisesmeans for transferring hints that are defined in terms of individualpoints associated with the contour of the character of the firstTrueType font by changing the definition of the hints to refer toindividual points associated with the contour of the character of thesecond TrueType font.
 11. The system of claim 8, wherein said means forpairing of the individual points defines one set of multiple pointpairs, and further comprising means for defining multiple sets of pointpairs, each set of point pairs comprising different pairings of points.12. The system of claim 11 further comprising: means for calculating ascore for each set of point pairs; means for selecting a set of pointpairs based upon the calculated score; said means for transferringcomprising means for using the selected set of point pairs as a basisfor transferring the hints.
 13. The system of claim 12, wherein saidmeans for calculating comprises: for each individual pair of points,means for calculating an individual local score; and means for summingthe individual local scores for all of the individual pairs of points toprovide an overall score for each set of point pairs; said means forselecting of the set of point pairs comprising means for selecting theset with the best overall score.
 14. The system of claim 1, wherein saidmeans for transferring comprises means for transferring one or moreconditionally-specified hints.
 15. The system of claim 1 furthercomprising means for defining at least one conditionally specified hintassociated with a character of the first TrueType font, and means fortransferring said conditionally specified hint if a condition associatedwith the conditionally specified hint is met by a correspondingcharacter of the second TrueType font.
 16. A system comprising: one ormore processors; one or more computer-readable media; computer-readableinstructions on the one or more computer-readable media which, whenexecuted by the one or more processors, cause the one or more processorsto execute a method comprising: selecting a first TrueType font that hasbeen hinted with hints that define constraints between control pointsassociated with individual characters of the font; identifyingindividual characters of a second TrueType font that correspond toindividual characters of the first TrueType font, the second TrueTypefont being different from the first TrueType font, individual charactersof the second TrueType font being unhinted; transferring hints fromcharacters of the first TrueType font to individual correspondingcharacters of the second TrueType font; discarding a hint where itappears inappropriate for a character of the second TrueType font; andmaintaining indicia of a discarded hint to indicate where a hint hasbeen discarded.
 17. The system of claim 16, wherein the first TrueTypefont comprises a font that has control-point level hints attached to itand said transferring of the hints comprises transferring thecontrol-point level hints from characters of the first TrueType font tocontrol-point level hints in characters of the second TrueType font. 18.The system of claim 17, wherein at least one control point of the firstTrueType font has been programmatically relocated to lie on top ofanother control point of the first TrueType font.
 19. The system ofclaim 16, wherein said selecting comprises selecting the first TrueTypefont from among a number of different fully hinted TrueType fonts. 20.The system of claim 16, wherein said selecting comprises automaticallyselecting the first TrueType font from among a number of different fullyhinted TrueType fonts that are resident in a library.